package com.quanxiaoha.framework.biz.context.config;


import com.quanxiaoha.framework.biz.context.filter.HeaderUserId2ContextFilter;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

/**
 * @Author: jingyan_liu
 * @CreateTime: 2025-07-18
 * @Description: A ServletContextInitializer to register Filters in a Servlet 3.0+ container.
 * Similar to the registration features provided by ServletContext but with a Spring Bean friendly design.
 * @Version: 1.0
 */


@AutoConfiguration
public class ContextAutoConfiguration {
	
	@Bean
	public FilterRegistrationBean<HeaderUserId2ContextFilter> filterFilterRegistrationBean() {
		return new FilterRegistrationBean<>(new HeaderUserId2ContextFilter());
	}
}
